﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using XCommunity.Data;

namespace XCommunity.Web.UI
{
  public class PagingContext<T>
  {

    public PagingContext( string name, IEnumerable<T> dataSource, int pageSize )
    {
      DataSource = dataSource;
      PageSize = pageSize;

      Paging = dataSource.ToPagingSource().CreatePaging( PageSize );

      Name = name;
    }


    protected IEnumerable<T> DataSource
    {
      get;
      private set;
    }

    public int PageSize
    {
      get;
      private set;
    }

    protected IPagingData<T> Paging
    {
      get;
      private set;
    }


    public string Name
    {
      get;
      private set;
    }


  }
}
